<?php

  //
  // Memorii Web
  // index.php
  //
  // Main page.
  //
  
  session_start();
  
  if(isset($_POST['email'])) {
  	require_once('script/db/db.php');
  	include('script/user/login.php');
  	
 		$msg = '';
 		if(!login($msg)) {
 	 		$_SESSION['msg'] = $msg;
 	 	}
 	}
  
  if(isset($_GET['activate'])) {
		include("script/user/activate_user.php");	
	}
	
  if(!isset($_SESSION["email"])) {
  	header('Location: login.php');
  }
  
?><!DOCTYPE HTML>
<html>
  <head>
    <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
    <title>Memorii Web</title>
    
    <link rel="shortcut icon" href="" />
    <link rel="stylesheet" type="text/css" href="style/main.css" />
    <link rel="stylesheet" type="text/css" href="style/folder.css" />
    <link rel="stylesheet" type="text/css" href="style/word.css" />
    
    <script type="text/javascript" src="script/js/jquery-1.4.2.min.js"> </script>
    
    <script type="text/javascript" src="script/js/main.js"> </script>
    <script type="text/javascript" src="script/js/word.js"> </script>
    <script type="text/javascript" src="script/js/folder.js"> </script>
  </head>
  <body>
    <header>
      <div onclick="go_home();">
      	<h1>Memorii Web</h1>
      	<img src="img/mii.png" alt="Mii" class="logo" />
     	 	<img src="img/title.png" alt="Memorii" class="title" />
     	</div>
     	<nav>
      	<div id="logout" onclick="logout();">
      		<span>Logout</span><img src="img/logout.png" alt="Logout"/>
				</div>
				<div id="settings" onclick="go_settings();">
					<span>Settings</span><img src="img/settings.png" alt="Settings"/>
				</div>
     	<nav>
    </header>
    <div class="content">
<?php 
	include("content/folder.php");
?>
    </div>
    <footer>
      <div>
        "Memorii Web" by Studio AMANgA - 2010
      </div>
      <div>
        <a href="http://www.studioamanga.com" name="StudioAMANgA">
          <img src="img/amgmini_gray.png" alt="amg" />
        </a>
      </div>
    </footer>
  </body>
</html>